const { defineConfig } = require('@vue/cli-service')
const Mock = require('mockjs')

const data = Mock.mock({
  "list|10": [{
    "id": "@id",
    "image": "@image(120x150, @color)",
    "title": "@ctitle",
    "desc": "@cword(10, 20)"
  }]
})
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    setupMiddlewares(middelwares, { app }) {
      app.get('/list', (req, res) => res.send(data.list))
      return middelwares;
    }
  }
})
